package com.sofwin.controller;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.sofwin.dto.IpoFirstSecondDto;
import com.sofwin.pojo.DIposecond;
import com.sofwin.pojo.DIpotellcode;
import com.sofwin.pojo.DIpotellcodeWithBLOBs;
import com.sofwin.service.DIpoFirstSecondService;
import com.sofwin.service.DIpotellcodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Project: ssm-parent
 * @Description: 数据字典的标准数据
 * @Author : abiao
 * @date Date : 2021年04月23日 下午 5:38
 */
@Controller
@RequestMapping("standard")
public class StandardDataController {
    @Autowired
    private DIpotellcodeService dIpotellcodeService;

    @Autowired
    private DIpoFirstSecondService ipoFirstSecondService;

    @RequestMapping("market")
    public String data(DIpotellcodeWithBLOBs dIpotellcodeWithBLOBs,@RequestParam(required = true,defaultValue = "1") Integer pageNumber,
                       @RequestParam(required = true,defaultValue = "2") Integer pageSize, Model model){
        PageInfo<DIpotellcodeWithBLOBs> ipotellcode = dIpotellcodeService.selectModel(dIpotellcodeWithBLOBs,pageNumber, pageSize);
        model.addAttribute("data",ipotellcode.getList());
        model.addAttribute("page",ipotellcode);
        model.addAttribute("dipo",dIpotellcodeWithBLOBs);
        return "ipo/shangshibankuai";
    }

    @RequestMapping("industry")
    public String data2(DIposecond iposecond,@RequestParam(required = true,defaultValue = "1") Integer pageNumber,
                        @RequestParam(required = true,defaultValue = "6") Integer pageSize,Model model){
        PageInfo<IpoFirstSecondDto> pageInfo = ipoFirstSecondService.selectFirstSecond(iposecond,pageNumber,pageSize);
        model.addAttribute("page",pageInfo);
        model.addAttribute("data",pageInfo.getList());
        model.addAttribute("isecond",iposecond);
        return "ipo/hangyeleibie";
    }
}
